digit [0-9]
letter [A-Za-z]
%{
  int count;
  int integer;
%}
%%
/* match identifier */
{letter}({letter}|{digit})* count++;
{digit}+ integer = integer++;
%%
int yywrap(void t) {
  return 1;
}
int main(int argc, char argv) {
  yyin = fopen(argv, "r");
  count = 0;
  integer = 0;
  yylex();
  fclose (yyin);
  printf("number of identifiers = %d\n", count);
  printf("number of integers = %d\n", integer);
  return 0;
}